<?php
/**
 * Created by PhpStorm.
 * User: yu
 * Date: 2017/8/6
 * Time: 下午5:00
 */

namespace app\api\validate;


use think\Validate;

class IntCheck extends BaseValidate
{
	protected $rule = [
		'id'=>'require|intPositive'
	];

	protected function intPositive($value,$rule,$data,$field=''){

		if(is_numeric($value)&& is_int($value+0)&&($value+0)>0){
			return true;
		}else{
			return $field.'必须是正整数';
		}
	}
}